#include <vector>
#include <iostream>
#include <algorithm>
#include <gtest/gtest.h>

int abs(int x) { return x > 0 ? x : -x; }

TEST(abs_test, test1) {}
void func()
{
    ASSERT_TRUE(abs(1) == 1);
    // ASSERT_TRUE(1 == 1);
    ASSERT_EQ(1, 1);
    ASSERT_NE(2, 1);
    ASSERT_LT(1, 2);
    ASSERT_GT(2, 1);
    ASSERT_LE(0, 1);
    ASSERT_GE(2, 1);
}
TEST(vector_test, push_back)
{
    std::vector<int> vec;
    vec.push_back(1);
    vec.push_back(2);
    vec.push_back(3);
    ASSERT_TRUE(vec.back() == 3);
}
TEST(vector_test, find)
{
    std::vector<int> vec;
    vec.push_back(1);
    vec.push_back(2);
    vec.push_back(3);
    ASSERT_EQ(*(std::find(vec.begin(), vec.end(), 3)), 3);
}
int main(int argc, char *argv[])
{
    // std::cout << "hello" << std::endl;
    testing::InitGoogleTest(&argc, argv);
    // 只能在返回值为void的函数内出现
    // ASSERT_TRUE(abs(1) == 1);
    return RUN_ALL_TESTS();
}